#ifndef WINDOWCONTROL_H
#define WINDOWCONTROL_H

#include <QQuickWindow>
#include <QObject>

class WindowControl : public QObject
{
    Q_OBJECT
public:
    WindowControl() {}
    ~WindowControl() {}
    void SetWindow(QQuickWindow *window) {
        m_window = window;
    }

public slots:
    void window_state_changed(Qt::WindowState window_state)
    {
        if (window_state == Qt::WindowMinimized) {
            qDebug("window minimized");
    //        emit disvisible_all_widget();
        }

        if (window_state == Qt::WindowActive) {
            qDebug("window active");
    //        emit disvisible_all_widget();
        }

        if (window_state == Qt::WindowMaximized) {
            qDebug("window maximized");
    //        emit disvisible_all_widget();
        }

        if (window_state == Qt::WindowFullScreen) {
            qDebug("window fullscreen");
    //        emit disvisible_all_widget();
        }

        if (window_state == Qt::WindowNoState) {
            qDebug("window no state");
    //        emit disvisible_all_widget();
        }
    }

    void show_maximized_window() {
        qDebug("window show maximized");
        m_window->showMaximized();
    }

    void show_minimized_window() {
        qDebug("window show minimized");
        m_window->showMinimized();
    }

private:
    QQuickWindow *m_window;
};

#endif // WINDOWCONTROL_H
